package com.congee02.springframework.bean;

import com.congee02.springframework.beans.DisposableBean;
import com.congee02.springframework.beans.factory.InitializingBean;

import java.util.HashMap;
import java.util.Map;

public class UserDao implements DisposableBean, InitializingBean {

    private Map<String, String> map;

    public void destroy() {
        map.clear();
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        map = new HashMap<>();
        map.put("1001", "A");
        map.put("1002", "B");
        map.put("1003", "C");
    }

    @Override
    public String toString() {
        return "UserDao{" +
                "map=" + map +
                '}';
    }
}
